package com.taobao.txc.common.c;

import java.nio.ByteBuffer;

public class v
  extends F
  implements q
{
  long a;
  String b;
  String c;
  byte d;
  public ByteBuffer e = ByteBuffer.allocate(1024);
  
  public void a(long paramLong)
  {
    this.a = paramLong;
  }
  
  public void a(String paramString)
  {
    this.b = paramString;
  }
  
  public void a(byte paramByte)
  {
    this.d = paramByte;
  }
  
  public String b()
  {
    return this.c;
  }
  
  public void b(String paramString)
  {
    this.c = paramString;
  }
  
  public String toString()
  {
    String str = this.c;
    if ((this.c != null) && (this.c.length() > 1024)) {
      str = this.c.substring(0, 1024) + "...(length:" + this.c.length() + ")";
    }
    return "RegisterMessage key:" + this.b + " tranId:" + this.a + " Commit mode:" + this.d + " business key:" + str;
  }
  
  public short b_()
  {
    return 11;
  }
  
  public byte[] c()
  {
    byte[] arrayOfByte1 = null;
    if (this.c != null)
    {
      arrayOfByte1 = this.c.getBytes(j);
      if (arrayOfByte1.length > 512) {
        this.e = ByteBuffer.allocate(arrayOfByte1.length + 1024);
      }
    }
    this.e.putLong(this.a);
    this.e.put(this.d);
    if (this.b != null)
    {
      arrayOfByte2 = this.b.getBytes(j);
      this.e.putShort((short)arrayOfByte2.length);
      if (arrayOfByte2.length > 0) {
        this.e.put(arrayOfByte2);
      }
    }
    else
    {
      this.e.putShort((short)0);
    }
    if (this.c != null)
    {
      this.e.putInt(arrayOfByte1.length);
      if (arrayOfByte1.length > 0) {
        this.e.put(arrayOfByte1);
      }
    }
    else
    {
      this.e.putInt(0);
    }
    this.e.flip();
    byte[] arrayOfByte2 = new byte[this.e.limit()];
    this.e.get(arrayOfByte2);
    return arrayOfByte2;
  }
  
  public void a(ByteBuffer paramByteBuffer)
  {
    this.a = paramByteBuffer.getLong();
    this.d = paramByteBuffer.get();
    int i = paramByteBuffer.getShort();
    if (i > 0)
    {
      byte[] arrayOfByte1 = new byte[i];
      paramByteBuffer.get(arrayOfByte1);
      a(new String(arrayOfByte1, j));
    }
    int j = paramByteBuffer.getInt();
    if (j > 0)
    {
      byte[] arrayOfByte2 = new byte[j];
      paramByteBuffer.get(arrayOfByte2);
      b(new String(arrayOfByte2, j));
    }
  }
}


/* Location:           C:\Users\ibm\Downloads\txc-yun-sample (1)\txc-yun-sample\lib\txc-client-2.0.72.jar
 * Qualified Name:     com.taobao.txc.common.c.v
 * JD-Core Version:    0.7.0.1
 */